
import 'dart:async';

import 'package:flutter/services.dart';

class FlutterWeightParser {
  static const MethodChannel _channel =
      const MethodChannel('flutter_weight_parser');


  static Future<List<String>?> loadProtocols(String url) {
    return _channel.invokeListMethod<String>("loadProtocols", {
      "protocolUrl": url
    });
  }

  static Future<String?> addAndParseWeight(String id, String proto, int frame) {
    return _channel.invokeMethod<String>("addAndParseWeight", {
      "frame": frame,
      "name": proto,
      "id": id
    });
  }

  static Future<bool?> removeGroup(String id) {
    return _channel.invokeMethod<bool>("removeGroup", {
      "id": id
    });
  }

  static Future<bool?> destroy() {
    return _channel.invokeMethod<bool>("destroy");
  }

}
